/****************************************************************
** Tutorial_Arduino_Analog_Read_Serial                       
**
** Original Author:      Sammy_K
** Webpage:              www.dreamgineer.org
**
** Project:              Dreamgineer Tutorials: Arduino
** Written On:           May 2012
** Last Updated:         May 2012
**
** A Simple Example That Demonstrates How To Read An Anlog
** Voltage On The Arduino, Scale It Into Voltage, And Transfer 
** The Value To The Development Computer Using The Arduino's 
** Serial Port
**
****************************************************************/

/****************************************************************
** setup() - Executes Once On Boot
**
** Configure The Serial Port With A Baud Rate Of 9600
**
****************************************************************/
void setup()
{
  //Configure Serial Port With Baud Rate = 9600
  Serial.begin(9600);      

  //Send String On Serial Port  
  Serial.print("Hello World!\n");
}

/****************************************************************
** loop() - Executes Repeatadly After setup() returns.
**
** Read AI0, Convert To Voltage, Transfer To Dev Computer
**
****************************************************************/
void loop()
{
  //Read AI0, Convert To Voltage, Transfer To Dev Computer
  Serial.println(analogRead(0) * .004888);
}


/****************************************************************
** Copyright (c) Dreamgineer.org
**
** Permission to use, copy, modify, and distribute this software 
** for any purpose with or without fee is hereby granted, 
** provided that the above copyright notice and this permission 
** notice appear in all copies. 
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 
** THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
** FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 
** CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
****************************************************************/

